package charpter12.lynx;


public class Eleven {
	private static class Error1 extends Exception{
		
	}
	
	private static class Error2 extends RuntimeException{
		public Error2(String msg){
			super(msg);
		}
	}
	
	private static void f() throws Error1{
		try {
			g();
		} catch (Exception e) {
			Error1 error1 = new Error1();
			error1.initCause(e);
			throw error1;
		}
	}
	
	private static void g() throws Error2{
		throw new Error2("haha");
	}
	
	public static void main(String[] args) {
		try {
			f();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
